home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 39 / Amiga Format CD39 (1999-04-13)(Future Publishing)(GB)[!][issue 1999-05].iso / -seriously_amiga- / graphics / ripley / source / mplay.h < prev    next >
C/C++ Source or Header  |  1999-03-02  |  2KB  |  136 lines

  1.  
  2. #include <intuition/intuition.h>
  3. #include <clib/macros.h>
  4. #include <libraries/asyncio.h>
  5.  
  6.  
  7. #define PROGNAME                "Ripley"
  8. #define    __VERSION__                " 0.40"
  9.  
  10. //#define    TASKPRIO                0
  11.  
  12. #define GUIGFX_VERSION            11
  13. #define    P96_VERSION                2
  14. #define    ASYNCIO_VERSION            39
  15. #define CGFX_VERSION            40
  16.  
  17. #define    DEFAULT_WINTITLE        PROGNAME __VERSION__
  18.  
  19. #define    DEFAULT_MINWIDTH        100
  20. #define    DEFAULT_MINHEIGHT        100
  21. #define    DEFAULT_MAXWIDTH        -1
  22. #define    DEFAULT_MAXHEIGHT        -1
  23.  
  24. #define    MINSCREENWIDTH            320
  25. #define    MINSCREENHEIGHT            200
  26. #define    MINSCREENDEPTH            2
  27.  
  28. #define    HISTOGRAMTYPE            HSTYPE_12BIT_TURBO
  29.  
  30. #ifdef __PPC__
  31.     #define inbufferlenght            2048
  32. #else
  33.     #define inbufferlenght            2048
  34. #endif
  35.  
  36. #define RNG(a,b,c) (MIN(MAX((a),(b)),(c)))
  37.  
  38. /*********************************************************************
  39. ----------------------------------------------------------------------
  40.  
  41.     structures
  42.  
  43. ----------------------------------------------------------------------
  44. *********************************************************************/
  45.  
  46. struct mvwindow
  47. {
  48.     struct mvscreen *screen;
  49.     struct Window *window;
  50.     
  51.     BOOL pipwindow;
  52.  
  53.     struct MsgPort *appmsgport;
  54.     struct AppWindow *appwindow;
  55.     ULONG appSignal;
  56.     ULONG idcmpSignal;
  57.  
  58.     UWORD winleft, wintop;
  59.     UWORD winwidth, winheight;
  60.     UWORD innerwidth, innerheight;
  61.     UWORD innerleft, innertop;
  62.  
  63.     WORD otherwinpos[4];            /* alternate window position x,y,w,h */
  64.  
  65.     ULONG idcmp;
  66.  
  67.     APTR drawhandle;
  68.     
  69.     APTR bufferpic;
  70.     
  71.     int sourcewidth, sourceheight;    // sourcebuffer
  72.     int sourcewidth16;
  73.     
  74.     BOOL gray;
  75.     
  76.     ULONG *rgbbuffer;
  77.     
  78.     APTR psm;
  79.     
  80.     APTR directdrawhandle;
  81.     
  82.     APTR timeHandle;
  83.     
  84.     int bright;
  85.     
  86.     char *title;
  87.     
  88.     int framerate;
  89.  
  90.     LONG whitepen, blackpen;
  91.  
  92.     int    frame;
  93.     
  94.     APTR p96address;
  95.  
  96. #ifdef __PPC__
  97.     void *timerObject;
  98.     long    ticks;
  99. #endif
  100.  
  101.     int visibleWidth;
  102.     int visibleHeight;
  103.     
  104.     BOOL halted;
  105. };
  106.  
  107.  
  108. #ifndef __PPC__
  109. extern struct AsyncFile    *AsyncInfile;
  110. #endif
  111.  
  112.  
  113.  
  114. extern void DeleteMVWindow (struct mvwindow *win);
  115.  
  116. extern struct Library *GuiGFXBase;
  117.  
  118. extern struct Library *CyberGfxBase;
  119.  
  120. extern BOOL mplay(struct mvwindow *window, unsigned char **buffer);
  121.  
  122.  
  123.  
  124. extern struct mvwindow *CreateMVWindow (struct mvscreen *scr, BOOL tryPip, int width, int height, BOOL gray, char *name, int framerate);
  125.  
  126. extern void UpdateWindowParameters(struct mvwindow *win);
  127.  
  128.  
  129. extern BOOL InitGlobal(void);
  130. extern void CloseGlobal(void);
  131.  
  132. extern void ppctimer (unsigned int *time);
  133.  
  134. extern void saveframe(unsigned char **src, struct mvwindow *win);
  135. extern void savebyte(int c,int outfile);
  136.